<link rel="stylesheet" href="../Public/style/user.css" />
<script type="text/javascript" src="../Public/js/register.js"></script>
<script src="__PUBLIC__/Js/jgsat.js"></script>
<script>
function tab_reg(){
	$("#reg").css('display','none');
	$("#login").css('display','');
	
	}
function tab_login(){
	$("#reg").css('display','');
	$("#login").css('display','none');
	
	}	

</script>
 <include file="Mobile:nav"/>
 <div id="reg">
  <!-- 共用头部1 -->
	 <div id="top">
		 <div class="head1 clear">
             <div class="title">绑定新账号</div> 
             <div class="search sprite_icon"  style="width:100px;">
			     <span class="keep" onclick="tab_reg()">绑定已有账号</span>
			 </div>
		 </div>
	 </div> 
       
     <style>
       .user_bg img{  border-radius: 50%;}
     </style>      
     <div class="user_bg U_padding">
		 <div style="width:65px; margin:0 auto; text-align:center ">
           <img width="65" height="65" src="{$qquserinfo['figureurl_qq_2']}" alt="" />
           <p>{$qquserinfo['nickname']}</p>
         </div>
	 </div>
 <form  id="myform2" method="post" action="{:U('Mobile/Register/doreg')}" onsubmit="return change_reg()" >
 <input type="hidden" name="openid" value="{$openid}" />
	 <div class="U_padding sb_user">
           <span id="error" style="color:#F00"></span>
		 <div class="text">
			 <div class="sb_text clear">
				 <em class="icon1 icon_com"></em>
				
				 <select id="group" name="groupid"   style="font-family: '微软雅黑'; width:80%;  height:34px;">
                  <option value="">请选择您的身份类型</option>
                      <volist name="Role"   id="r">
                         <?php if($r['status']==1){?>
                         <option  value="<?php echo ($r['id'])?>"><?php echo ($r['name'])?></option>
                         <?php } ?>
                     </volist>
                 </select> 

				 
			 </div>
			 
		 </div>

		 <div class="text">	
		     <div class="sb_text clear">
				 <em class="icon3 icon_com"></em>
				 <input type="text" id="mobile"  placeholder="手机号码" name="mobile" />
			 </div>
			 
		 </div>

		 <div class="text clear">
			 <div class="sb_text2">
				 <em class="icon4 icon_com"></em>
                          
				 <input type="text" class="text2" placeholder="验证码" name="mobileyzm" id="mobileyzm"/>
			 </div>
                                 <div class="auth_code" id="auth_code_yzm" style="display: none">
                                    <label style=" height:20px;">
                                    <img src="{:U('Home/Index/verify')}" onclick="javascript:resetVerifyCode();" class="checkcode" align="absmiddle"  title="{:L('resetVerifyCode')}" id="verifyImage"/>点击图片刷新
                                    </label>
                                    <label>
                                        <input style="background:#FFF" type="text" value="" class="authCodeText" id="txt_mathcode" name="verifyCode">
                                        <input type="button" class="autoCodeButton" value="确认" id="btn_mathcode">
                                    </label>
                                    
                                    <em class="arrow_front"></em>
                                    <em class="arrow_background"></em>
            
                                  </div>
			
              <input type="button"  id="btn_mss_r" class="wind_spans4 send" value="获取验证码" />
		 </div>
	     

		 <div class="text">	
		     <div class="sb_text clear">
				 <em class="icon5 icon_com"></em>
				 <input type="text" name="username" placeholder="昵称" id="name_d" />
			 </div>
			 
		 </div>

		 <div class="text">	
		     <div class="sb_text clear">
				 <em class="icon6 icon_com"></em>
				 <input type="password" id="password" name="password" placeholder="请输入密码"  />
			 </div>
			 
		 </div>

		 
         <input id="wind_spans3" type="submit" value="注册" id="subbnt"class="register" style="margin:0; font-family:微软雅黑;float:left;" />

	     <div class="readed clear" style="margin-top:40px;">
			 <input name="Iagreen" class="w_check2" type="checkbox" value="1" validate="required:true" />
			 <p>我已经认真阅读并同意了餐饮空间的《<a href="index.php?g=Mobile&m=Page&a=index&id=13">使用条款</a>》</p>
		 </div>
		 
	 </div>
     </form>
 </div> 
   

<style>
.wind_zhuce1 li{position: relative;}
.mess{position: absolute;
      left: 380px;
	  z-index:99}	
 .auth_code{ 
	position: absolute;
    width: 167px;
    height: 70px;
    background: #f6fff9;
    border: 1px solid #d6ded9;
    display: none;
    top: 270px;
    left: 118px;
    z-index: 100;}
    .auth_code label input.authCodeText {
    float: left;
    width: 80px;
	height:24px;
	line-height:24px;
    text-indent: 5px;}
	
	.auth_code label input.autoCodeButton {
    float: right;
    width: 45px;
    height: 24px;
	line-height:24px;
    border: 1px solid #f36f20;
    background: #dd4f50;
    color: #fff;
    padding: 0;}
	
	.auth_code em {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    font-size: 0;
    display: inline-block;
    border-width: 10px;
    border-color: #f6fff9 transparent transparent transparent;
    border-style: solid dashed dashed dashed;
    z-index: 2;
    bottom: -19px;
    left: 75px;
}	
    .auth_code label {
    width: 145px;
    margin: 6px 0 6px 12px;
    display: block;
    clear: both;
    overflow: hidden;}	
	
	.slide_btn ,.customization{ display:none}	
</style>

<div id="login" style="display:none">

	 <div id="top">
		 <div class="head1 clear">
             <div class="title">绑定已有账号</div> 
             <div class="search sprite_icon"  style="width:100px;">
			     <span class="keep" onclick="tab_login()">绑定新账号</span>
			 </div>
		 </div>
	 </div>	 
<div class="user_bg U_padding">
		 <div style="width:65px; margin:0 auto; text-align:center ">
           <img width="65" height="65" src="{$qquserinfo['figureurl_qq_2']}" alt="" />
           <p>{$qquserinfo['nickname']}</p>
         </div>
	 </div> 
<script type="text/javascript">
function validate(){
  document.getElementById('loginfrm').submit();
}
</script>
         
	 <div class="U_padding sb_user border_bottom">
     <form method="post" action="{:URL('Mobile-Login/dologin')}" name="loginfrm" id="loginfrm">
        <input type="hidden" id="forward" name="forward" value="index.php?g=Mobile"/>
        <input type="hidden" name="openid" value="{$openid}" />
		 <div class="text">	
		     <div class="sb_text clear">
				 <em class="icon5 icon_com"></em>
				 <input   type="text" name="username" placeholder="用户名/邮箱/手机号"/>
			 </div>
			 
		 </div>

		 <div class="text">	
		     <div class="sb_text clear">
				 <em class="icon6 icon_com"></em>
				 <input type="password" name="password" placeholder="请输入密码">
			 </div>
		 </div>

		 <div class="login_btn">
			 <a href="{:URL('Mobile-Register/index')}" class="btn1">注册</a>
			 <a href="javascript:validate();" class="btn2 active">登录</a>
		 </div>

		 <div class="forgive_poss">
			 <a href="index.php?g=Mobile&m=Register&a=edit">忘记密码？</a>
		 </div>
         </form>
	 </div>
     
 </div>    









<script type="text/javascript">
$('#btn_mss_r').click(function(){
       var tel = $.trim($('#mobile').val());
	  // alert(tel)
	   if(tel=='' || tel=='手机号码'){alert('请输入您的手机号码')}else{
		   var partten = /^[1][34578][0-9]{9}$/;
		
		   if(partten.test(tel)){
			 document.getElementById('auth_code_yzm').style.display="block";	
		   }else{alert('手机号格式错误')}
	  }
 });


//点击图形验证码后
$('#btn_mathcode').click(function(){
       var tel = $.trim($('#mobile').val());
	   var yzm=$('#txt_mathcode').val();
	   //alert(tel)
	   if(tel=='' || tel=='手机号码'){alert('请输入您的手机号码')}
       var partten = /^[1][34578][0-9]{9}$/;
	   
	  if(partten.test(tel) &&  yzm){
		  
		  $.post('index.php?g=User&m=Sms&a=index&register=1', {'tel':tel,'yzm':yzm},function(res){
              // alert(res);
			  if(res!=0){ 
			      alert('发送失败:'+res);
				 
			  }else{
				  time(document.getElementById("btn_mss_r"));
				    alert('发送成功');
			     
				 
			   }
			  
              });
			  document.getElementById('auth_code_yzm').style.display="";	
	   }//else{alert('请输入手机号')}
 });


var wait=120;
  function time(o) {
    if (wait == 0) {
      o.removeAttribute("disabled");
      o.value="免费获取验证码";
      wait = 120;
    } else {
      o.setAttribute("disabled", true);
      o.value="重新发送(" + wait + ")";
      wait--;
      setTimeout(function() {
                time(o)
              },
              1000)
    }
  }



$('#btn_mathcode').click(function(){
	
	})

 supportPlaceholder='placeholder'in document.createElement('input'),
  
   //身份
   $('#group').change(function(e){
               // var opts = $('#x>li');
                //opts.removeClass('p');
                for (var i = 0; i <= 2; i++) {
                    if($(this).val()==1) {
                        $("#name_c").html('真实姓名：');
                        $("#name_d").attr('placeholder','真实姓名');
						 if(!supportPlaceholder){ $("#name_d").val('真实姓名');}
					
                    }
					if($(this).val()==2) {
                        $("#name_c").html('昵称：');
                        $("#name_d").attr('placeholder','昵称');
						if(!supportPlaceholder){ $("#name_d").val('昵称');}
						
                    }
                    if($(this).val()==3) {
                        $("#name_c").html('公司名称：');
                        $("#name_d").attr('placeholder','公司名字');
						if(!supportPlaceholder){ $("#name_d").val('公司名字');}
						
                    }
                };
 
            });
			
	
</script>
  